<!-- 
    @author Wójcik Karol <wojcikk@student.agh.edu.pl>
    @licence http://www.gnu.org/copyleft/gpl.html GNU/GPL
-->

<div title="Account signup" id="signupform" class="form">
  <%= error_messages_for 'user' %><br/>
   
  <% if @session['user'].role == "admin" %>
  
    <label for="user_name">Imi&#281;</label><br/>
    <%= text_field "user", "name", :size => 30 %><br/>
    
    <label for="user_surname">Nazwisko</label><br/>
    <%= text_field "user", "surname", :size => 30 %><br/>
  
    <label for="user_mark_id">Stopie&#324;</label><br/>
    <%=  select("user", "mark_id", Mark.find(:all).collect {|p| [ p.name, p.id ] }) %><br/>
  
    <label for="user_position_id">Stanowisko</label><br/>
    <%=  select("user", "position_id", Position.find(:all).collect {|p| [ p.name, p.id ] }) %><br/>
  
    <label for="user_email">Adres e-mail</label><br/>
    <%= text_field "user", "email", :size => 30 %><br/>

    <label for="user_position">Rola</label><br/>
    <%= select("user", "role", {"Administrator" => "admin","Prowadzacy" => "prowadzacy"}, {:include_blank => true})  %><br/>
 
    <label for="user_login">Login:</label><br/>
    <%= text_field "user", "login", :size => 30 %><br/>
  
    <label for="user_password">Has&#322o:</label><br/>
    <%= password_field "user", "password", :size => 30, :value =>""   %><br/>
  
    <label for="user_password_confirmation">Powt&#243;rz has&#322o:</label><br/>
    <%= password_field "user", "password_confirmation", :size => 30, :value =>""  %><br/>
    <br/>
  
  <% else %>
  
    <label for="user_name">Imi&#281;</label><br/>
    <%= text_field "user", "name", :size => 30, :disabled => true %><br/>
    
    <label for="user_surname">Nazwisko</label><br/>
    <%= text_field "user", "surname", :size => 30 , :disabled => true%><br/>
  
    <label for="user_mark_id">Stopien</label><br/>
    <%=  select("user", "mark_id", Mark.find(:all).collect {|p| [ p.name, p.id ] },{}, {:disabled => true }) %><br/>
  
    <label for="user_position_id">Stanowisko</label><br/>
    <%=  select("user", "position_id", Position.find(:all).collect {|p| [ p.name, p.id ] },{}, {:disabled => true }) %><br/>
  
    <label for="user_email">Adres e-mail</label><br/>
    <%= text_field "user", "email", :size => 30 , :disabled => true%><br/>

    <label for="user_position">Rola</label><br/>
    <%= select("user", "role", {"Administrator" => "admin","Prowadzacy" => "prowadzacy"}, {:include_blank => true}, {:disabled => true })  %><br/>
 
    <label for="user_login">Login:</label><br/>
    <%= text_field "user", "login", :size => 30, :disabled => true %><br/>
  
    <label for="user_password">Haslo:</label><br/>
    <%= password_field "user", "password", :size => 30, :value =>""   %><br/>
  
    <label for="user_password_confirmation">Powtorz haslo:</label><br/>
    <%= password_field "user", "password_confirmation", :size => 30, :value =>""  %><br/>
    <br/>
    
  <% end %>
  
<input type="submit" value="Zmien &#187;" class="primary" />

<%= end_form_tag %>

